#region File Description
//-----------------------------------------------------------------------------
// Game.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.GamerServices;
using Arcadium.Graphics;
using Microsoft.Xna.Framework.Net;
using Arcadium.Screens.Menus.Sidebar;
#endregion

namespace Arcadium
{
    /// <summary>
    /// Sample showing how to manage different game states, with transitions
    /// between menu screens, a loading screen, the game itself, and a pause
    /// menu. This main game class is extremely simple: all the interesting
    /// stuff happens in the ScreenManager component.
    /// </summary>
    public class ArcadiumGame : Microsoft.Xna.Framework.Game
    {
        #region Fields

        ScreenManager screenManager;

        static readonly string[] preloadAssets =
        {
            "Extras\\VoluminousInteractive",
            "MenuSidebar\\background"
        };

        
        #endregion

        #region Initialization


        /// <summary>
        /// The main game constructor.
        /// </summary>
        public ArcadiumGame()
        {
            Content.RootDirectory = "Content";

            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            // Create the view component.
            View.Create(screenManager);

            // Add Gamer Services
            Components.Add(new GamerServicesComponent(this));

            // Add a Message Display
            Components.Add(new MessageDisplayComponent(this));

            // Activate the first screen.
            screenManager.AddScreen(new StartupScreen(), null);

            // Listen for invite notification events.
            NetworkSession.InviteAccepted += (sender, e)
                => MenuSidebar.InviteAccepted(screenManager, e);
        }


        /// <summary>
        /// Loads graphics content.
        /// </summary>
        protected override void LoadContent()
        {
            foreach (string asset in preloadAssets)
            {
                Content.Load<object>(asset);
            }
        }

        #endregion

    }
}
